<template>
  <Swiper class="swipers">
    <SwiperItem v-for="(item,index) in topImages" :key="index">
      <img :src="item" alt="" @load="imagesLoad">
    </SwiperItem>
  </Swiper>
</template>

<script>
  import {Swiper,SwiperItem} from "components/common/swiper";

  export default {
    name: "DetailSwiper",
    components:{
      Swiper,
      SwiperItem
    },
    props:{
      topImages:{
        type: Array,
        default(){
          return [];
        }
      }
    },
    data(){
      return {
        isTrue: true
      };
    },
    methods:{
      imagesLoad(){
        if (this.isTrue){
          this.$emit("imagesLoads");
          this.isTrue = false;
        }
      }
    }
  }
</script>

<style scoped>
  .swipers{
    height: 300px;
    overflow: hidden;
  }
</style>
